//lcd.h
/* Standard includes */
#include <stdint.h>

//First blank, and the hex codes, which all display quite
//well on a 7-segment display.
#define CHAR_SPACE          0
#define CHAR_ALL            (SEG_a|SEG_b|SEG_c|SEG_d|SEG_e|SEG_f|SEG_g|SEG_h)
#define CHAR_0              (SEG_a|SEG_b|SEG_c|SEG_d|SEG_e|SEG_f)
#define CHAR_1              (SEG_b|SEG_c)
#define CHAR_2              (SEG_a|SEG_b|SEG_d|SEG_e|SEG_g)
#define CHAR_3              (SEG_a|SEG_b|SEG_c|SEG_d|SEG_g)
#define CHAR_4              (SEG_b|SEG_c|SEG_f|SEG_g)
#define CHAR_5              (SEG_a|SEG_c|SEG_d|SEG_f|SEG_g)
#define CHAR_6              (SEG_a|SEG_c|SEG_d|SEG_e|SEG_f|SEG_g)
#define CHAR_7              (SEG_a|SEG_b|SEG_c)
#define CHAR_8              (SEG_a|SEG_b|SEG_c|SEG_d|SEG_e|SEG_f|SEG_g)
#define CHAR_9              (SEG_a|SEG_b|SEG_c|SEG_d|SEG_f|SEG_g)
#define CHAR_A              (SEG_a|SEG_b|SEG_c|SEG_e|SEG_f|SEG_g)
#define CHAR_B              (SEG_c|SEG_d|SEG_e|SEG_f|SEG_g)
#define CHAR_C              (SEG_a|SEG_d|SEG_e|SEG_f)
#define CHAR_D              (SEG_b|SEG_c|SEG_d|SEG_e|SEG_g)
#define CHAR_E              (SEG_a|SEG_d|SEG_e|SEG_f|SEG_g)
#define CHAR_F              (SEG_a|SEG_e|SEG_f|SEG_g)
#define CHAR_MINUS          (SEG_g)

#define SEG_a       0x01
#define SEG_b       0x02
#define SEG_c       0x04
#define SEG_d       0x08
#define SEG_e       0x40
#define SEG_f       0x10
#define SEG_g       0x20
#define SEG_h       0x80

#define LCD_MEM_OFFSET  2   //offset from LCDMEM[0]
#define LCD_MEM_LOC    11   //num of LCDMEM[] locations used

/* function prototypes */
/* function to write to clear LCD memory */
void clrLCD(void);
/* function to write to initialize LCD memory */
void vInitLCD(void);
/* function to put a segment pattern at a specified position on the LCD display */
void LCDchar
(
  int ch, //segment pattern [input]
  int pos //position in memory [input]
);
/* function to convert uint16_t input value to decimal LCD display value */
void LCDdec
(
  uint16_t val, //decimal value [input]
  int pos //position in display [input]
);
/* function to initialize LCD ports */
void vPortsInit(void);



/************* Added FreeRTOS functionality **************/
void vStartLCDdisplayTasks
( 
  unsigned portBASE_TYPE uxPriority 
);